<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateFeishuCallingCardsFranchiseeClues extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('feishu_calling_cards_franchisee_clues', function (Blueprint $table) {
            $table->id();
            $table->string('openid', 32)->default('')->comment('微信用户 openid');
            $table->string('detailAddress', 255)->default('')->comment('用户详细地址');
            $table->string('clientIp', 44)->default('')->comment('用户IP');
            $table->string('province', 20)->default('')->comment('省');
            $table->string('city', 20)->default('')->comment('市');
            $table->string('district', 20)->default('')->comment('区');
            $table->string('name', 50)->default(0)->comment('姓名');
            $table->char('mobile', 20)->default('')->comment('手机号');
            $table->unsignedBigInteger('invitorId')->comment('用户主键');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->index(['openid'], 'openid');
            $table->comment = '飞书线索表';
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('feishu_calling_cards_franchisee_clues');
    }
}
